load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "azure",
    srcs = [
        "azure_connection.go",
        "azure_file_credential.go",
        "azure_kms.go",
        "azure_kms_connection.go",
        "azure_storage.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/cloud/azure",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/cloud/externalconn",
        "//pkg/cloud/externalconn/connectionpb",
        "//pkg/cloud/externalconn/utils",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/util/envutil",
        "//pkg/util/ioctx",
        "//pkg/util/log",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_azure_azure_sdk_for_go_sdk_azcore//:azcore",
        "@com_github_azure_azure_sdk_for_go_sdk_azcore//policy",
        "@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
        "@com_github_azure_azure_sdk_for_go_sdk_keyvault_azkeys//:azkeys",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//:azblob",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//blob",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//blockblob",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//container",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//service",
        "@com_github_azure_go_autorest_autorest//azure",
        "@com_github_cockroachdb_errors//:errors",
        "@in_gopkg_yaml_v2//:yaml_v2",
        "@io_opentelemetry_go_otel//attribute",
    ],
)

go_test(
    name = "azure_test",
    srcs = [
        "azure_connection_test.go",
        "azure_file_credentials_test.go",
        "azure_kms_connection_test.go",
        "azure_kms_test.go",
        "azure_storage_test.go",
    ],
    embed = [":azure"],
    deps = [
        "//pkg/base",
        "//pkg/blobs",
        "//pkg/cloud",
        "//pkg/cloud/cloudpb",
        "//pkg/cloud/cloudtestutils",
        "//pkg/cloud/externalconn",
        "//pkg/cloud/externalconn/connectionpb",
        "//pkg/security/username",
        "//pkg/settings/cluster",
        "//pkg/testutils",
        "//pkg/testutils/skip",
        "//pkg/util/envutil",
        "//pkg/util/leaktest",
        "@com_github_azure_azure_sdk_for_go_sdk_azcore//:azcore",
        "@com_github_azure_azure_sdk_for_go_sdk_azidentity//:azidentity",
        "@com_github_azure_azure_sdk_for_go_sdk_storage_azblob//service",
        "@com_github_azure_go_autorest_autorest//azure",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
        "@in_gopkg_yaml_v2//:yaml_v2",
    ],
)
